With the rapid development of transaction systems in recent years, existing database management systems (DBMS) have been improved significantly. In addition, the number of users and services have increased as well as the number and complexity of transactions in transaction systems, which lead to frequent changes in DBMS data. The ACID (Atomicity, Consistency, Isolation and Durability) of the DBMS implements and ensures the stability and durability of the DBMS data. Durability represents that persistent data consistency is guaranteed in an event of a Host failure. At present, the DBMS employs an open MySQL database product, which is implemented through asynchronous data replications between a master and a slave. The master first records a change in data in a binary log (called binlog), which records an event when data is written into the master or when a data change occurs in the master. The slave executes events recorded in a relay log, and updates data stored therein using events recorded in the binlog. During a process of an asynchronous data replication between a master and a slave, the slave may fail to timely replicate data in the master if an abnormal situation suddenly occurs in the master, which results in a data loss.
In order to resolve data losses caused by an asynchronous data replication between a master and a slave in the MySQL database, an existing solution primarily includes a semi-synchronous replication mode for the MySQL database. Under the semi-synchronous replication mode, a master and at least one slave are set up. After the master completes an execution of a certain transaction thereof, a delay is set to wait for the slave to execute that transaction. The master will continue to wait until any one of the slaves has executed the transaction, thus avoiding data losses, which are caused by an occurrence of abnormality in the master that makes the slave fail to replicate data in the master timely.
Deficiencies apparently exist in existing technologies as described above. The semi-synchronous replication mode for the MySQL database is difficult to implement, and an extra delay that is added to the execution of a single transaction increases the time for data backup. In addition, if an abnormality occurs in a slave in the semi-synchronous replication mode for the MySQL database, a master cannot receive any transaction messages sent by the slave. The master will switch to an asynchronous replication mode after the delay is ended, and will remain in the asynchronous replication mode, thus having certain deficiencies.